package cn.wolfcode.p2p.base.domain;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;

import lombok.Getter;
import lombok.Setter;

/**
 * 实名认证对象
 * 
 * @author wolfcode
 *
 */
@Setter
@Getter
public class RealAuth extends BaseAuditDomain {

	public static final int SEX_MALE = 0;
	public static final int SEX_FEMALE = 1;

	private String realName;
	private int sex;
	private String idNumber;
	private String bornDate;
	private String address;

	private String image1;
	private String image2;

	public String getSexDisplay() {
		return this.sex == SEX_FEMALE ? "女" : "男";
	}

	public String getJsonString() {
		Map<String, Object> json = new HashMap<>();
		json.put("id", id);
		json.put("username", applier.getUsername());
		json.put("realName", realName);
		json.put("idNumber", idNumber);
		json.put("sex", getSexDisplay());
		json.put("bornDate", bornDate);
		json.put("address", address);
		json.put("image1", image1);
		json.put("image2", image2);
		return JSONObject.toJSONString(json);
	}

}
